package com.ihighest.app.infox.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebSettings;
import android.webkit.WebView;

import com.ihighest.app.infox.R;

public class AdvertisementContentActivity extends BaseActivity {
	private WebView web;
	private String url;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.infox_activity_advertisementcontent);
		web = (WebView) findViewById(R.id.AdContent);
		url = getIntent().getStringExtra("vlaue");
		WebSettings settings = web.getSettings();
		settings.setSupportZoom(true); // 支持缩放
		settings.setBuiltInZoomControls(true); // 启用内置缩放装置
		settings.setJavaScriptEnabled(true); // 启用JS脚本
		web.loadUrl(url);
		findViewById(R.id.AdContentBack).setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent(AdvertisementContentActivity.this, MainActivity.class);
				startActivity(intent);
				finish();

			}
		});
	}

	@Override
	public void onBackPressed() {
		if (web.canGoBack()) {
			web.goBack();
		} else {
			Intent intent = new Intent(AdvertisementContentActivity.this, MainActivity.class);
			startActivity(intent);
			finish();
		}
	}
}
